package com.zkthink.ceres.order.dao;

import com.zkthink.base.mapper.SuperMapper;
import com.zkthink.ceres.order.entity.GoodsReturn;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

/**
 * <p>
 * Mapper 接口
 * 
 * </p>
 *
 * @author JustArgo
 * @date 2020-05-10
 */
@Repository
public interface GoodsReturnMapper extends SuperMapper<GoodsReturn> {

    /** 历史申请的退货单，需要增加版本
     * @author JustArgo 2020/5/20 22:38
     * @return
     */
    int increseVersion(Long orderId);

	/** 查询是否有跟当前申请的s订单商品冲突的退货单
	 * @author 善泉 2020/6/30 18:44
	 * @return
	 */
	int getConflictCount(GoodsReturn goodsReturn);

	/** 如果这个订单商品之前已经申请过售后，并且处于审核失败 或者退款失败，则将版本号+1
	 * @author 善泉 2020/6/21 11:23
	 * @return
	 */
	int increseVersionByOrderProductId(@Param("orderId")Long orderId, @Param("orderProductId")Long orderProductId);
}
